This invention relates to the field of image processing, and in particular to tone scale processing of digital images.
The dynamic range of a scene or an image is the ratio of its maximum intensity to its minimum intensity. Similarly, the dynamic range of a visual display, such as a color monitor, or a print medium, such as photographic paper, is the ratio of the maximum luminance to the minimum luminance that is rendered on the display or the print medium. In conventional optical printing, when an image has a larger dynamic range than can be rendered on an output medium, there will be loss of details in the rendering process, especially in the highlight or shadow areas. Digital image processing can be used to preserve the image details by compressing the input dynamic range only on the very low frequency component in the input image. U.S. Pat. No. 5,012,333 teaches a method for such an operation. An input image is decomposed into a high frequency component and a low frequency component. The image value in the low frequency component is mapped through a lookup table which compresses the dynamic range by a tone scale curve with an average slope less than one. A tone scale curve, as the term is used herein, is a function that maps an input image value to an output image value. When the units used for the input and the output image values are both proportional to log exposure or lightness of the scene, the slope of the tone scale curve is known to correlate well with the perceived contrast of the image.
It is desirable to have an automatic method of constructing an image-dependent tone scale curve for a given input digital image such that the dynamic range of the input image is so compressed as to render most image details visible. For example, if the image contains a highlight area that is illuminated by bright sunlight and a shadow area that is illuminated only by dim skylight, it would be desirable that detail in both areas would be rendered visible. Because of the large difference in the luminance level of the two illuminations, the tonal range of the highlight is well separated from that of the shadow. If the histogram of the input image values is examined, one can see a gap between the highlight and the shadow clusters. In this case, the tonal range corresponding to the gap can be greatly compressed without creating undesirable artifacts because there are no pixels within that tonal range. The limited output dynamic range should be fully allocated to the highlight tonal range and to the shadow tonal range, with nothing wasted for the tonal range corresponding to the gap in between.
Prior algorithms for dynamic range allocation, such as the well known method of histogram equalization, are based on the histogram of pixel values of the entire image. There are two drawbacks with this type of approach: (a) a large uniform area (such as sky or a wall) in the image will cause a large output dynamic range to be allocated for that area. This is not desirable because the area is uniform and does not need much output dynamic range; (b) the pixels corresponding to a large peak in the histogram may not be spatially adjacent to each other in the image. Although collectively, their number may be very large, the image values of their neighboring pixels may be quite different from them and therefore they do not need a large output range for rendering.
To solve the first of these problems, U.S. Pat. No. 4,654,722 teaches a method of using a Laplacian operator to select only edge pixels for inclusion in the histogram. Therefore, most pixels in the large uniform areas are not included. Such a method can reduce the problem of large uniform areas, but does not truly measure image signal modulations. U.S. Pat. No. 5,633,511 teaches a method that is based on the histogram of image activities, not on image values. Image activity measures how much signal modulation takes place at each image value. Although the ""511 patent teaches the use of image activity to set the parameter values in a family of tone scale curves, it does not teach the use of image activity to allocate the output dynamic range to the tone ranges in the input image values so that an image-dependent tone scale curve of a non-predetermined shape can be constructed.
The present invention is directed to overcoming one or more of the problems set forth above. Briefly summarized, according to one aspect of the present invention, a method of generating an image-dependent tone scale curve includes (a) computing an image activity histogram for an input image value as a function of the number of neighboring pixels that have a predetermined amount of image modulation exclusive of a predetermined noise modulation; and (b) constructing an image-dependent tone scale curve from the image activity histogram. The predetermined amount of image modulation may comprise any image value within two specified intervals each bounded by a noise threshold and amodulation threshold.
In another aspect of the present invention, the invention involves a method of generating a tone scale curve that optimizes the rendering of image activity under one or more constraints. More particularly, the invention involves establishing one or more slope-limit constraints and then constructing a tone scale slope function by applying the slope-limit constraints in a tone scale derivative space. An image activity histogram is computed and applied to the tone scale slope function. Finally, the tone scale slope function is integrated to generate the tone scale curve. In yet another aspect, the invention involves establishing one or more point constraints and then constructing a tone scale slope function in a piecewise manner by applying the point constraints in the tone scale derivative space. The image activity histogram is computed and applied to the tone scale slope function, and the tone scale slope function is integrated to generate the tone scale curve.
In a further aspect, the output dynamic range (Vmin, Vmax) of an output medium is measured. For an input digital image, two histograms are computed: the image activity histogram and an image value histogram. The minimum image value Umin and the maximum value Umax of the input image are determined from its image value histogram. A balance point is also determined for the image, such that a certain image value Uaim is tentatively mapped to itself with an output value Vaim=Uaim. A white point, Uwhite, is also determined by detecting the presence of any white object in the image. The input as well as the output dynamic range are both partitioned into the upper range and the lower range by the mapping of a chosen anchor point.
These and other aspects, objects, features and advantages of the present invention will be more clearly understood and appreciated from a review of the following detailed description of the preferred embodiments and appended claims, and by reference to the accompanying drawings.